2023-04-09

Central Limit Theorem

The Central Limit Theorem(CLT) states that if a distribution has a finite variance, the mean of a set of samples from the distribution approaches the mean of the original distribution.

It also says that the distribution of the means of the set of samples is normally distributed.

We can test this out with the exponential distribution, which has a finite variance \(1/\lambda^2\)

Exponential Distribution

\[fx(x|\lambda)=\begin{cases} \lambda e^{-\lambda x} & for\,x>0\\ 0 & for\,x\leq0 \end{cases}\]

where \(\lambda\) = differential rate, mean = \(1/\lambda\), and variance is \(1/\lambda^{2}\).

Exponential Distribution sample of n=1000, with theoretical distribution fitting

Distribution of means

We sample out 1000 sets of 40 replicates each (i.e. 40 * 1000 samples) from an exponential distribution with \(\lambda=0.2\), take the mean of each of those 40 replicates and get 1000 means.

Distribution of 1000 Means for 40 replicates of exponential distribution, with theoretical distribution fitting

We see a normal distribution

It’s Playtime

This is cool, right? Now what if we can change \(\lambda\), the number of bins or replicates, and the number of samples?

The CLT doesn’t always hold, especially for small number of samples.

Presenting an app which lets you play around and change these values to generate the plots. Do check it out.